import requests


class UesrManage(object):
    @classmethod
    def add_user(cls,headers,body):
        url= "http://ihrm-test.itheima.net/api/sys/user"
        response=requests.post(url,headers=headers,json=body)
        return response
    # @classmethod
    # def get_user(cls,headers,id):
    #     url="http://ihrm-test.itheima.net/api/sys/user/" + id
    #     response=requests.get(url,headers=headers)
    #     return response
    # @classmethod
    # def modify_user(cls,headers,id,body):
    #     url="http://ihrm-test.itheima.net/api/sys/user/" +id
    #     response=requests.put(url,headers=headers,json=body)
    #     return response
    # @classmethod
    # def delete_user(cls,headers,id):
    #     url="http://ihrm-test.itheima.net/api/sys/user/" +id
    #     response=requests.delete(url,headers=headers)
    #     return response
# if __name__=="__main__":
# add_user_headers = {"Content-Type": "application/json", "Authorization": "Bearer 5258af71-48d6-496b-85a5-69104dfff2e9"}
# add_user_body = {
#         "username": "YG",
#         "mobile": "18210222555",
#         "workNumber": "9905051914"
#     }
#     # modify_body = {
#     #     "username": "YG002",
#     #     "password": "123456",
#     #     "departmentId": "10086"
#     # }
#     # id= "1518800851085410304"
# resp=UesrManage.add_user(headers=add_user_headers,body=add_user_body)
#     # resp1=UesrManage.get_user(headers=add_user_headers,id=id)
# print(resp.json())
    # print(resp1.json())
    # resp2=UesrManage.modify_user(headers=add_user_headers,id=id,body=modify_body)
    # print(resp2.json())
    # resp3=UesrManage.delete_user(headers=add_user_headers,id=id)
    # print(resp3.json())
